package com.nicy.controller;

import com.nicy.model.Student;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class HelloController {

    @GetMapping("/hi1")
    public Student hi1(){
        //return new Student("xiaoming", Integer.valueOf(12));
        return  null;
    }

    @PostMapping("/hi2")
    public Student hi2(@RequestBody Student student){
        return student;
    }

    @PostMapping("/hi3")
    public Student hi3(@RequestBody Student student){
        log.info("输出日志,student:{}",student);
        return student;
    }
}
